#! /bin/sh
set -x

eps1out=data.eps
eps2out=mig.eps
nt=401 dt=.01 ft=0.0
nx=201 dx=0.04 DX=40 fx=0.0
DVDZ=.6
TRISO=0
DVDX=0.0
ANGXS=0

# make synthetic data
susynlvfti >junksss angxs=$ANGXS er=1 ob=0 v00=1.5 delta=0.0 epsilon=0.2 fpeak=10 dvdx=0 dxm=$dx nxm=$nx dt=$dt nt=$nt dvdz=$DVDZ smooth=1 \
ref="1:0.0,.5;1.0,.5;2.,2.0;3.0,2.0;4.0,3.0;5.0,2.0;6.0,2.0"

#plot synthetic data
suximage <junksss label1="Time (s)" label2="Midpoint (km)" \
d1num=1 n1=$nt d1=$dt titlesize=30 x1end=5 x2end=8 n1tic=2 grid1=solid grid2=solid n2=$nx \
d2=$dx f2=0.0 f2num=0.0 d2num=1.0 n2tic=5 labelsize=24 \
title="Model Data" xbox=50 ybox=50 &

#generate a velocity file vt.F
vtlvz dt=$dt nt=$nt v0=1500 a=$DVDZ >vt.F

#migrate data
sumigpsti <junksss vnfile=vt.F vfile=vt.F dx=$DX tmig=0. etamig=.2 >tttss

#Plot result of migration
suximage <tttss label1="Time (s)" label2="Midpoint (km)" n1=401 n1tic=2 \
x2end=4 x1end=4 f2=0.0 d2=.02 title="PS TI migration" xbox=800 ybox=50 &

exit
